import request from '@/utils/request'
// 获取员工列表
export function sysUser (params) {
  return request({
    url: '/sys/user',
    params
  })
}
// 删除用户
export function sysUserDel (id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}
// 新增用户

export function sysUserAdd (data) {
  return request({
    url: `/sys/user`,
    method: 'post',
    data
  })
}
// 批量新增员
export function sysUserBatch (data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
// 修改用户信息
export function sysUserPut (data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
// 员工隐私信息
export function employeesPersonalInfo (id) {
  return request({
    url: `/employees/${id}/personalInfo`
  })
}
// 修改员工隐私信息
export function employeesPersonalInfoPut (data) {
  return request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}
// 获取员工岗位详情
export function employeesJobs (id) {
  return request({
    url: `/employees/${id}/jobs`
  })
}
// 修改员工岗位信息
export function employeesJobsPut (data) {
  return request({
    url: `/employees/${data.userId}/jobs`,
    method: 'put',
    data
  })
}

// 修改员工角色
export function sysUserAsignRolesPut (data) {
  return request({
    url: `/sys/user/assignRoles`,
    method: 'put',
    data
  })
}
